//---------------------------------------------------------------------------

#ifndef motorH
#define motorH

#include "circulo.h"
#include <gl\gl.h>
#include <gl\glu.h>
//---------------------------------------------------------------------------

class Motor {
        public: Circulo * base;
                PV * satelite;
                float rs;
                GLdouble ang;
                bool reboto_antes[50];

                Motor(){};
                Motor(PV * cb,float rb, PV * cs,float r){
                                        base = new Circulo (cb,rb);
                                        satelite = cs;
                                        rs = r;
                                        ang=0.02;
                                        for(int i=0;i<50;i++)
                                                reboto_antes[i] = false;};
                 Motor(PV * cb,float rb, PV * cs,float r, GLdouble a){
                                        base = new Circulo (cb,rb);
                                        satelite = cs;
                                        rs = r;
                                        ang=a;
                                        for(int i=0;i<50;i++)
                                                reboto_antes[i] = false;};
                ~Motor(){
                        delete base;
                        delete satelite;};

                void rota(){
                                satelite->rotaP(base->centro,ang);
                            };
                void draw();
                bool invasion(PV * pos,PV * sen,GLdouble rad,PV * &normal);
                bool invasion2(PV * pos,PV * sen,GLdouble rad,PV * &normal);
};

#endif
